import request from '@/utils/axiosRequest.js'

//

export function getAllWorkers(){
  return request({
    url: "/system/worker/list",
    method: "get"
  })
}

// 添加
export function addWorker(worker) {
  return request({
    url: "/system/worker",
    method: "post",
    data: worker
  })
}

// 更新
export function updateWorker(worker) {
  return request({
    url: "/system/worker",
    method: "put",
    data: worker
  })
}

// 账号激活、冻结
export function updateWorkerStatus(workerId) {
  return request({
    url: "/system/worker/status/" + workerId,
    method: "put"
  })
}

// 批量删除
export function deleteWorkers(workerIdList) {
  return request({
    url: "/system/worker/batch",
    method: "delete",
    data: workerIdList
  })
}


// 重置密码
export function resetPassword(workerId) {
  return request({
    url: "/system/worker/resetPassword/" + workerId,
    method: "put"
  })
}
